home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / librw / RWWSubString.z / RWWSubString
Encoding:
Text File  |  1998-10-30  |  10.4 KB  |  265 lines

  1.  
  2.  
  3.  
  4. RRRRWWWWWWWWSSSSuuuubbbbSSSSttttrrrriiiinnnngggg((((3333CCCC++++++++))))                                          RRRRWWWWWWWWSSSSuuuubbbbSSSSttttrrrriiiinnnngggg((((3333CCCC++++++++))))
  5.  
  6.  
  7.  
  8. NNNNaaaammmmeeee
  9.      RWWSubString - Rogue Wave library class
  10.  
  11. SSSSyyyynnnnooooppppssssiiiissss
  12.               #include <rw/wstring.h>
  13.  
  14.  
  15.  
  16.               RWWString s(L"test string");
  17.           s(6,3);   // "tri"
  18.  
  19.  
  20.  
  21.  
  22. DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn
  23.      The class RRRRWWWWWWWWSSSSuuuubbbbSSSSttttrrrriiiinnnngggg allows some subsection of an RRRRWWWWWWWWSSSSttttrrrriiiinnnngggg to be
  24.      addressed by defining a ssssttttaaaarrrrttttiiiinnnngggg ppppoooossssiiiittttiiiioooonnnn and an eeeexxxxtttteeeennnntttt.  For example the
  25.      7th through the 11th elements, inclusive, would have a starting position
  26.      of 7 and an extent of 5.  The specification of a starting position and
  27.      extent can also be done in your behalf by such functions as
  28.      RRRRWWWWWWWWSSSSttttrrrriiiinnnngggg::::::::ssssttttrrrriiiipppp(((()))) or the overloaded function call operator taking a
  29.      regular expression as an argument.  There are no public constructors --
  30.      RRRRWWWWWWWWSSSSuuuubbbbSSSSttttrrrriiiinnnnggggssss are constructed by various functions of the RRRRWWWWWWWWSSSSttttrrrriiiinnnngggg class
  31.      and then destroyed immediately.  A zzzzeeeerrrroooo lllleeeennnnggggtttthhhhsubstring is one with a
  32.      defined starting position and an extent of zero.  It can be thought of as
  33.      starting just before the indicated character, but not including it.  It
  34.      can be used as an lvalue.  A null substring is also legal and is
  35.      frequently used to indicate that a requested substring, perhaps through a
  36.      search, does not exist.  A null substring can be detected with member
  37.      function iiiissssNNNNuuuullllllll(((()))).  However, it cannot be used as an lvalue.
  38.  
  39. PPPPeeeerrrrssssiiiisssstttteeeennnncccceeee
  40.      None
  41.  
  42. EEEExxxxaaaammmmpppplllleeee
  43.               #include <rw/rstream.h>
  44.           #include <rw/wstring.h>
  45.           main(){
  46.            RWWString s(L"What I tell you is true.");
  47.            // Create a substring and use it as an lvalue:
  48.            s(15,0) = RWWString(L" three times");
  49.            cout << s << endl;
  50.            return 0;
  51.           }
  52.  
  53.  
  54.      PPPPrrrrooooggggrrrraaaammmm oooouuuuttttppppuuuutttt::::
  55.  
  56.               What I tell you three times is true.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. RRRRWWWWWWWWSSSSuuuubbbbSSSSttttrrrriiiinnnngggg((((3333CCCC++++++++))))                                          RRRRWWWWWWWWSSSSuuuubbbbSSSSttttrrrriiiinnnngggg((((3333CCCC++++++++))))
  71.  
  72.  
  73.  
  74. AAAAssssssssiiiiggggnnnnmmmmeeeennnntttt OOOOppppeeeerrrraaaattttoooorrrrssss
  75.  
  76.  
  77.  
  78.  
  79.               void
  80.           ooooppppeeeerrrraaaattttoooorrrr====(const RWWString&);
  81.  
  82.  
  83.      Assignment from an RRRRWWWWWWWWSSSSttttrrrriiiinnnngggg.  The statements:
  84.  
  85.               RWWString a;
  86.  
  87.  
  88.  
  89.               RWWString b;
  90.           b(2, 3) = a;
  91.  
  92.  
  93.      will copy aaaa's data into the substring bbbb((((2222,,,,3333)))).  The number of elements
  94.      need not match: if they differ, bbbb will be resized appropriately.  If self
  95.      is the null substring, then the statement has no effect.
  96.  
  97.               void
  98.           ooooppppeeeerrrraaaattttoooorrrr====(const wchar_t*);
  99.  
  100.  
  101.      Assignment from a wide character string.  Example:
  102.  
  103.               RWWString wstr(L"Mary had a little lamb");
  104.  
  105.  
  106.  
  107.               wchar_t dat[] = L"Perrier";
  108.           wstr(11,4) = dat;     // "Mary had a Perrier"
  109.  
  110.  
  111.      Note that the number of characters selected need not match: if they
  112.      differ, wwwwssssttttrrrr will be resized appropriately.  If self is the null
  113.      substring, then the statement has no effect.
  114.  
  115. IIIInnnnddddeeeexxxxiiiinnnngggg OOOOppppeeeerrrraaaattttoooorrrrssss
  116.               wchar_t
  117.           ooooppppeeeerrrraaaattttoooorrrr[[[[]]]](size_t i);
  118.           wchar_t&
  119.           ooooppppeeeerrrraaaattttoooorrrr[[[[]]]](size_t i) const;
  120.  
  121.  
  122.      Returns the iiiith character of the substring.  The first variant can be
  123.      used as an lvalue, the second cannot.  The index iiii must be between zero
  124.      and the length of the substring less one.  Bounds checking is performed:
  125.      if the index is out of range, then an exception of type RRRRWWWWBBBBoooouuuunnnnddddssssEEEErrrrrrrr will
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. RRRRWWWWWWWWSSSSuuuubbbbSSSSttttrrrriiiinnnngggg((((3333CCCC++++++++))))                                          RRRRWWWWWWWWSSSSuuuubbbbSSSSttttrrrriiiinnnngggg((((3333CCCC++++++++))))
  137.  
  138.  
  139.  
  140.      be thrown.
  141.  
  142.               wchar_t
  143.           ooooppppeeeerrrraaaattttoooorrrr(((())))(size_t i);
  144.           wchar_t&
  145.           ooooppppeeeerrrraaaattttoooorrrr(((())))(size_t i) const;
  146.  
  147.  
  148.      Returns the iiiith character of the substring.  The first variant can be
  149.      used as an lvalue, the second cannot.  The index iiii must be between zero
  150.      and the length of the substring less one.  Bounds checking is enabled by
  151.      defining the pre-processor macro RRRRWWWWBBBBOOOOUUUUNNNNDDDDSSSS____CCCCHHHHEEEECCCCKKKK before including
  152.      <<<<rrrrwwww////wwwwssssttttrrrriiiinnnngggg....hhhh>>>>.  In that case, if the index is out of range, then an
  153.      exception of type RRRRWWWWBBBBoooouuuunnnnddddssssEEEErrrrrrrr will be thrown.
  154.  
  155. PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr FFFFuuuunnnnccccttttiiiioooonnnnssss
  156.               RWBoolean
  157.           iiiissssNNNNuuuullllllll() const;
  158.  
  159.  
  160.      Returns TTTTRRRRUUUUEEEE if this is a null substring.
  161.  
  162.               size_t
  163.           lllleeeennnnggggtttthhhh() const;
  164.  
  165.  
  166.      Returns the extent (length) of the RRRRWWWWWWWWSSSSuuuubbbbSSSSttttrrrriiiinnnngggg.
  167.  
  168.               RWBoolean
  169.           ooooppppeeeerrrraaaattttoooorrrr!!!!() const;
  170.  
  171.  
  172.      Returns TTTTRRRRUUUUEEEE if this is a null substring.
  173.  
  174.               size_t
  175.           ssssttttaaaarrrrtttt() const;
  176.  
  177.  
  178.      Returns the starting element of the RRRRWWWWWWWWSSSSuuuubbbbSSSSttttrrrriiiinnnngggg.
  179.  
  180.               void
  181.           ttttooooLLLLoooowwwweeeerrrr();
  182.  
  183.  
  184.      Changes all upper-case letters in self to lower-case. Uses the C library
  185.      function ttttoooowwwwlllloooowwwweeeerrrr(((()))).
  186.  
  187.               void
  188.           ttttooooUUUUppppppppeeeerrrr();
  189.  
  190.  
  191.      Changes all lower-case letters in self to upper-case. Uses the C library
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. RRRRWWWWWWWWSSSSuuuubbbbSSSSttttrrrriiiinnnngggg((((3333CCCC++++++++))))                                          RRRRWWWWWWWWSSSSuuuubbbbSSSSttttrrrriiiinnnngggg((((3333CCCC++++++++))))
  203.  
  204.  
  205.  
  206.      function ttttoooowwwwuuuuppppppppeeeerrrr(((()))).
  207.  
  208. GGGGlllloooobbbbaaaallll LLLLooooggggiiiiccccaaaallll OOOOppppeeeerrrraaaattttoooorrrrssss
  209.               RWBoolean
  210.           ooooppppeeeerrrraaaattttoooorrrr========(const RWWSubString&, const RWWSubString&);
  211.           RWBoolean
  212.           ooooppppeeeerrrraaaattttoooorrrr========(const RWWString&,    const RWWSubString&);
  213.           RWBoolean
  214.           ooooppppeeeerrrraaaattttoooorrrr========(const RWWSubString&, const RWWString&   );
  215.           RWBoolean
  216.           ooooppppeeeerrrraaaattttoooorrrr========(const wchar_t*,      const RWWSubString&);
  217.           RWBoolean
  218.           ooooppppeeeerrrraaaattttoooorrrr========(const RWWSubString&, const wchar_t*     );
  219.  
  220.  
  221.      Returns TTTTRRRRUUUUEEEE if the substring is lexicographically equal to the wide
  222.      character string or RRRRWWWWWWWWSSSSttttrrrriiiinnnngggg argument.  Case sensitivity is eeeexxxxaaaacccctttt.
  223.  
  224.               RWBoolean
  225.           ooooppppeeeerrrraaaattttoooorrrr!!!!====(const RWWString&,    const RWWString&   );
  226.           RWBoolean
  227.           ooooppppeeeerrrraaaattttoooorrrr!!!!====(const RWWString&,    const RWWSubString&);
  228.           RWBoolean
  229.           ooooppppeeeerrrraaaattttoooorrrr!!!!====(const RWWSubString&, const RWWString&   );
  230.           RWBoolean
  231.           ooooppppeeeerrrraaaattttoooorrrr!!!!====(const wchar_t*,      const RWWString&   );
  232.           RWBoolean
  233.           ooooppppeeeerrrraaaattttoooorrrr!!!!====(const RWWString&,    const wchar_t*     );
  234.  
  235.  
  236.      Returns the negation of the respective ooooppppeeeerrrraaaattttoooorrrr========(((())))
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.